<template>
  <div>
<div>汽车信息：一辆{{ car.name }}需要{{ car.price }}万元</div>
<button @click="changePrice">改变汽车价格</button>
<div>
  游戏信息：
  <ul>
    <li v-for="game in games" :key="game.id">{{ game.name }}</li>
  </ul>
</div>
<button @click="changeFirstName">改变第一款游戏名字</button>

  </div>
</template>
<script lang="ts" setup name="Person">
import { ref } from 'vue';

let car=ref({name:'奔驰',price:100})
let games=ref(
  [
    {id:"01",name:"王者荣耀"},
    {id:"02",name:"原神"},
    {id:"03",name:"球球大作战"}
  ]
  )

  function changePrice(){
    car.value.price+=10
  }
  function changeFirstName(){
    games.value[0].name="和平精英"
  }

</script>
<style>

</style>